<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="../vue.js"></script>
</head>
<body>
    <div id="app">
        <form action="javascript:;">
            <!-- 表示去掉数据前后的空格 -->
            <input type="text" v-model.trim="msg">
            
            <!-- 表示表单改变失去焦点后获取数据 -->
            <input type="text" v-model.lazy="msg">

            <!-- 表示将数据转为数字,无法转变则不变 -->
            <input type="text" v-model.number="number">
            
        </form>
    </div>
    <script>
        new Vue({
            el:"#app",
            data(){
                return{
                    msg:'',
                    number:0
                }
            }
        })
    </script>
</body>
</html>